package com.example.tvwanandroid.presenter

import com.example.tvwanandroid.base.BaseListResult
import com.example.tvwanandroid.base.BaseObserver
import com.example.tvwanandroid.base.BasePresenter
import com.example.tvwanandroid.bean.NavigationBean
import com.example.tvwanandroid.view.NavigationView

/**
 * @作者: njb
 * @时间: 2020/12/9 10:20
 * @描述:
 */
class NavigationPresenter(baseView: NavigationView):BasePresenter<NavigationView>(baseView) {

    fun getNavigation(){
        addDisposable(apiServer.navi(),object :BaseObserver<BaseListResult<NavigationBean.DataBean>>(baseView){
            override fun onSuccess(o: BaseListResult<NavigationBean.DataBean>) {
                baseView.onLoadNavigation(o.data!!)
            }

            override fun onError(msg: String?) {
                baseView.showError(msg!!)
            }
        })
    }
}